package sort;

import java.util.LinkedList;
import java.util.List;

public class Sorters {


	public static <T extends Comparable<T>> void quickSort(List<T> list) {
		int size = list.size();
		if (size <= 1) {
			return;
		}
		List<T> before = new LinkedList<T>();
		List<T> after = new LinkedList<T>();
		T pivot = list.get(size - 1);
		for (int i = 0; i < size - 1; i++) {
			T t = list.get(i);
			if (pivot.compareTo(t) >= 0) {
				before.add(t);
			} else {
				after.add(t);
			}
		}
		list.clear();
		quickSort(before);
		list.addAll(before);
		list.add(pivot);
		quickSort(after);
		list.addAll(after);
	}

	public static void mergeSort(List<Integer> al) {
		// TODO Auto-generated method stub
		
	}
}
